/*
 * @Author: HeAo
 * @Date: 2021-09-27 14:05:33
 * @LastEditTime: 2021-09-27 14:23:42
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2105\3-1-ES6\day03\1-函数传参.js
 * 别乱动！
 */
let myFun1 = function (a, b, c = 10) {
  console.log(a, b, c);
}
myFun1(2, 3)

let myFun2 = function ({ a, b, c = 10 }) {
  console.log(a, b, c);
}
myFun2({ b: 1, a: 2 })

let myFun3 = function ([a, b, c]) {
  console.log(a, b, c);
}
myFun3([, 'larry', 'jacky'])

// ...用在函数形参位置，叫rest参数，也叫拓展运算符的逆运算
let myFun4 = function (a, b, ...c) {
  // console.log(arguments);
  console.log(a, b, c);
}

myFun4(1, 2, 3, 4, 5, 6)
